<?php




    require_once 'public/includes/functions.php';
    require_once 'models/container.php';
    require_once 'models/user.php';
    
   class regisController extends functions {
        var $container= null;
        var $user =null;
        
        
        function __construct(){
            $this->container = new Container_Model(); 
            $this->user = new user_Model();
                      
        }
        
        public function addAction(){   
           
        	$name=$_POST['tendangnhap'];
            $matkhau=$_POST['matkhau'];
        	$email=$_POST['email'];
            $diachi=$_POST['diachi'];
        	$sdt=$_POST['sdt'];
            $fullname=$_POST['fullname'];
                	
            if($this->user->add($name,$matkhau,$fullname,$email,$diachi,$sdt)>0){
                unset($_POST);
                $this->user->ShowMessage('Bạn đã đăng ký thành công');
            }else{
                $this->user->ShowMessage("Đã xảy ra lỗi, vui lòng thử lại");
            }                 
        }
       
    }
    
    $regis = new regisController();
    if(isset($_POST['submit'])){
        $regis->addAction();
    }
  
   
    $regis->show('regis');


?>